<script src="__PUBLIC__/ganged/Js/city-picker.data.js"></script>
<script src="__PUBLIC__/ganged/Js/city-picker.js"></script>
<script src="__PUBLIC__/ganged/Js/main.js"></script>
<!-- css -->
<link href="__PUBLIC__/ganged/Css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/ganged/Css/city-picker.css" rel="stylesheet" type="text/css" />
<div class="container" style="padding-top: 50px;">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <form class="form-horizontal" role="form" id="post_form" action="{:U('send')}">
                <div class="form-group">
                    <label for="signname" class="col-sm-2 control-label">签名:<span style="color: red;">*</span></label>
                    <div class="col-sm-6">
                        <input type="text" class="form-control" name="signname" id="signname"/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="model_id" class="col-sm-2 control-label">模板id:<span style="color: red;">*</span></label>
                    <div class="col-sm-6">
                        <input type="text" class="form-control" name="model_id" id="model_id"/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="mobiles" class="col-sm-2 control-label">手机号码:</label>
                    <div class="col-sm-6">
                        <textarea type="text" class="form-control" id="mobiles" name="mobiles" rows="4">{$item.value}</textarea>
                        多个“,”号分隔。为空表示发送所用用户
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="button" class="btn btn-primary" id="btn" lng="0" lat="0">提交</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
<script>
$(function(){
    $("#btn").click(function(){
            var $form = $("#post_form");
            var $data = {};
            var $form_data = $form.serializeArray();
            $.each($form_data, function(k, v){
                $data[v['name']] = v['value'];
            })
            $.post($form.attr('action'), $data, function(obj){
                alert(obj.m);
                if(obj.s){
                    if(typeof(obj.url)!= "undefined" && obj.url){
                        location.href = obj.url;
                    }
                }
            })
            return false;
        })
    });
</script>
